void accelStr(String *aStr) {
  *aStr = String(accel.s.x) + comma + String(accel.s.y) + comma + String(accel.s.z);
}

void gyroStr(String *aStr) {
  *aStr = String(gyroRate.s.x) + comma + String(gyroRate.s.y) + comma + String(gyroRate.s.z);
}

void altStr(String *aStr) {
  *aStr = String((pAlt.altitude()*10)/305) + comma+ String(pAlt.agl()) + comma;
  *aStr += String(sx.range) + comma + String(gps.alt);
}

void gpsStr(String *aStr) {
  *aStr = String(gps.lat) + comma + String(gps.lon) + comma + String(gps.vNorth) + comma;
  *aStr += String(gps.vEast) + comma + String(compass_head);
}

void pwrStr(String *aStr) {
  *aStr = String(servo1_cmd) + comma + String(servo2_cmd) + comma + String(servo3_cmd) + comma;
  *aStr += String(servo4_cmd) + comma + String(battery);
}

void imuStr(String *aStr) {
  *aStr =  String(inu.attitude.getW()) + comma + String(inu.attitude.getX()) + comma;
  *aStr += String(inu.attitude.getY()) + comma + String(inu.attitude.getZ()) + comma;
  *aStr += String(inu.velocity.s.x) + comma + String(inu.velocity.s.y) + comma + String(inu.velocity.s.z);
}

void imuOffStr(String *aStr) {
  *aStr =  String(inu.gyroOffset.s.x) + comma + String(inu.gyroOffset.s.y) + comma + String(inu.gyroOffset.s.z) + comma;
  *aStr += String(inu.accelOffset.s.x) + comma + String(inu.accelOffset.s.y) + comma + String(inu.accelOffset.s.z);
}

void imuBodyStr(String *aStr) {
  *aStr =  String(inu.bodyVelocity.s.x) + comma + String(inu.bodyVelocity.s.y) + comma + String(inu.bodyVelocity.s.z);
}

void imuAttStr(String *aStr) {
  *aStr =  String(compass_head) + comma + String(inu.attitude.heading()) + comma + String(inu.attitude.pitch()) + comma + String(inu.attitude.roll());
}


void imuErrStr(String *aStr) {
  //Vector3 vErr;
  //inu.attitude.body2ned(inu.accelOffset.r, vErr.r);
  *aStr = String(millis()) + comma + String(inu.accelOffset.s.x) + comma + String(inu.accelOffset.s.y) + comma + String(inu.accelOffset.s.z) + comma;
  *aStr += String(inu.velocity.s.x) + comma + String(inu.velocity.s.y) + comma + String(inu.velocity.s.z);
  //*aStr += String(inu.gBiasErr.s.x) + comma + String(inu.gBiasErr.s.y) + comma + String(inu.gBiasErr.s.z);
  //*aStr =  String(millis()) + comma + String(inu.velocity.s.z) + comma + String(inu.accelOffset.s.z) + comma + String(inu.accelErr.s.z);
  //*aStr =  String(millis()) + comma + String(inu.accelErr.s.x) + comma + String(inu.accelOffset.s.x) + comma + String(inu.netAccel.s.x) + comma + String(tUpdate);
  //*aStr =  String(millis()) + comma + String(accelInt.s.x) + comma + String(accelInt.s.y) + comma + String(accelInt.s.z) + comma + String(tUpdate);
  //*aStr =  String(accelBias.s.x) + comma + String(accelBias.s.y) + comma + String(accelBias.s.z);
  //*aStr =  String(millis()) + comma + String(inu.aOffNED.s.x) + comma + String(inu.aOffNED.s.y) + comma + String(inu.aOffNED.s.z) + comma;
  //*aStr += String(inu.gBiasErr.s.x) + comma + String(inu.gBiasErr.s.y) + comma + String(inu.gBiasErr.s.z);
  //*aStr =  String(millis()) + comma + String(gyroRate.s.x) + comma + String(gyroRate.s.y) + comma + String(gyroRate.s.z) + comma;
  //*aStr = String(millis()) + comma + String(compass_head) + comma + String(inu.estHead) + comma + String(inu.headErr);
  //*aStr +=  String(inu.attitude.heading()) + comma + String(inu.attitude.pitch()) + comma + String(inu.attitude.roll()) + comma + String(inu.nedAccel.s.x);
  //*aStr += String(inu.attitude.getW()) + comma + String(inu.attitude.getX()) + comma;
  //*aStr += String(inu.attitude.getY()) + comma + String(inu.attitude.getZ());
  //*aStr += String(compass_head);
}

void imuBAStr(String *aStr) {
  *aStr =  String(bodyAccel.s.x) + comma + String(bodyAccel.s.y) + comma + String(bodyAccel.s.z);
}

void matStr(String *aStr) {
  
  *aStr = String(inu.attitude.R[0][0]) + comma + String(inu.attitude.R[0][1]) + comma + String(inu.attitude.R[0][2]) + '\n';
  *aStr += String(inu.attitude.R[1][0]) + comma + String(inu.attitude.R[1][1]) + comma + String(inu.attitude.R[1][2]) + '\n';
  *aStr += String(inu.attitude.R[2][0]) + comma + String(inu.attitude.R[2][1]) + comma + String(inu.attitude.R[2][2]);
}
